home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
CSUBR.LZH
/
L_JUST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1985-12-13
|
821b
|
29 lines
/***********************************************************************/
/* */
/* Left justify string str in size length field. */
/* */
/***********************************************************************/
int l_just(str, size)
char *str;
int size;
{
char *s, *d;
int len, count;
len = strlen(str); /* get string length */
if (len > size) /* truncate, if necessary */
str[size] = 0x00;
else if (len < size) {
count = size - len; /* number of blanks to insert */
s = str + len;
while (count--)
*s++ = ' '; /* add leading blanks */
*s = 0x00; /* and terminate is properly */
}
return str;
}